<style>
.width {
	min-width: 119px;
}
	.modalwidth {
	width: 550px;	
	height: 240px;
}
</style>


<section class="wrapper">


	<div class="col-lg-12">
		<!--work progress start-->
		<section class="panel">

			<div class="inbox-head">
				<h3>LISTING MANAGEMENT</h3>
				<a href="<?= base_url();?>secure/listing/add"><button type="button" class="btn btn-danger pull-right">
					<i class="icon-plus"></i>
				</button></a>
			</div>
		
				

			<div class="panel-body">
				
				
				<div class="input-group pull-right">
				
                                          <form name="action" method="POST"
							action="<?=base_url(); ?>secure/listing/inactive">
				
							
							<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />
							<div class="col-lg-offset-2 col-lg-7">
							</div>
							 <select class="form-control" name="filter" style="width:100px"
								onchange="this.form.submit()">
								<option value="">-Select-</option>
								<option value="inactive">Inactive</option>
								<option value="active">Active</option>
							
							</select>
						</form>
                                          
                                          
                                             
                                              </div>
			
				<table class="table table-striped table-advance table-hover">
				<?php if($post){?>
					<thead>
						<tr>
						<th><i class="icon-bullhorn"></i> Title</th>
                         <th><i class="icon-bookmark"></i> Business Plan</th>
						<th><i class="icon-bookmark"></i> Description</th>
						<th><i class="icon-bookmark"></i> Status</th>
						<th><i class=" icon-edit"></i> Action</th>
						</tr>
					</thead>
					<tbody>
					<?php foreach($post as $post):?>
                        <?php
                        $plan = getPK('membership',$post->plan);
                        $plan = $plan['name'];
                        ?>
					<tr>
						<th><?= $post->title;?>
						</th>

                        <td><div class="badge"><?= $plan; ?></div> </td>

						<td><?= substr($post->description,0,40);?></td>
						<td>
						<?php if($post->status == '51'){?>
							<button class="btn btn-success btn-xs">
								<i class=" icon-ok"> Active</i>
							</button> 
							<?php }else{?>
								<button class="btn btn-danger btn-xs">
								<i class=" icon-ok"> Inactive</i>
								</button>
								
								
							<?php }?>
							</td>


						<td>

							<div class="dropdown">
								<a href="javascript:;"
									class="dropdown-toggle btn btn-danger btn-xs"
									data-toggle="dropdown">Menu <b class="caret"></b>
								</a>
								<ul class="dropdown-menu width">
								<?php if($post->status == '51'){?>
										<li>
										
									<a href="<?= base_url();?>secure/listing/changestatus/<?= $post->status;?>/<?= $post->id;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-danger btn-xs">
												<i class="icon-thumbs-down"></i>
											</button> Inactive</a>
											</li>
											<?php }else{?>
											<li>
									<a href="<?= base_url();?>secure/listing/changestatus/<?= $post->status;?>/<?= $post->id;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-primary btn-xs">
												<i class="icon-thumbs-up"></i>
											</button> Active</a>
											
											</li>	
									
											<?php }?>
											<li><a href="<?= base_url();?>secure/listing/logo/<?= $post->id;?>"
									><button
												class="btn btn-info btn-xs">
												<i class="icon-picture"></i>
											</button> Logo</a></li>
											<li><a href="<?= base_url();?>secure/listing/photo/<?= $post->id;?>"
									><button
												class="btn btn-warning btn-xs">
												<i class="icon-picture"></i>
											</button> Photo</a></li>
											<li><a href="<?= base_url();?>secure/listing/video/<?= $post->id;?>"
									><button
												class="btn btn-danger btn-xs">
												<i class="icon-facetime-video"></i>
											</button> Video</a></li>
									<li><a href="<?= base_url();?>secure/listing/edit/<?= $post->id;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-primary btn-xs">
												<i class="icon-pencil"></i>
											</button> Edit</a></li>
									<li><a href="#"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-danger btn-xs">
												<i class="icon-trash"></i>
											</button> Delete</a></li></ul>
							
							</div>
							
							
						</td>
					</tr>
					<?php endforeach;?>
<?php }?>
						
					</tbody>
					
				</table>
				
  <!-- <p class="text text-warning">Opps! No Product found....</p> -->
			</div>

		</section>
		<!--work progress end-->
	</div>

</section>

